<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>四六级在线报名系统-报名页面</title>
  <script src="js/jquery-3.3.1.min.js"></script>
	<link rel="stylesheet" href="layui/css/layui.css" media="all"></link>
	<script src="layui/layui.js"></script>
	<script src="layer/layer.js"></script>
	<link rel="stylesheet" href="layer/mobile/need/layer.css" />
	<link rel="stylesheet"  href="layer/theme/default/layer.css"/>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
  <div class="layui-header" style="background-color: #F0F0F0;">
    <div class="layui-logo">
    	<img src="img/161230188.jpg"  height="90%"/>
    </div>
    <!-- 头部区域（可配合layui已有的水平导航） -->
    <ul class="layui-nav layui-layout-left">
 </ul>
    <ul class="layui-nav layui-layout-right">
    	
    	     <li class="layui-nav-item"> <a href="cethome.html"><font size="5" color="#000">首页</font></a></li>
<li class="layui-nav-item"><a href="about.html" target="_self"><font size="5" color="#000">考试简介</font></a> </li>
<li class="layui-nav-item"><a href="time.html" target="_self"><font size="5" color="#000">考试动态</font></a> </li>
<li class="layui-nav-item"><a href="problems.html" target="_self"><font size="5" color="#000">常见问题</font></a> </li>
<li class="layui-nav-item"><a href="tips.html" target="_self"><font size="5" color="#000">温馨提示</font></a></li>
<li class="layui-nav-item"><a href="ulogin.html" target="_self"><font size="5" color="#000">登录系统</font></a></li>
<li class="layui-nav-item"><a href="register.html" target="_self"><font size="5" color="#000">报名注册</font></a></li>
    </ul>
  </div>
  
</div>   
</div>
 <script src="js/config.js"></script>
 
 
<link rel="stylesheet" type="text/css" href="css/ulogin.css">
 
 
 
	<head>
		<meta charset="utf-8"></meta>
		<title>layui</title>
		<meta name="renderer" content="webkit"></meta>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></meta>
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"></meta>
		<link rel="stylesheet" href="layui/css/layui.css" media="all"></link>
	</head>
	<body>
	 
<script src="http://code.jquery.com/jquery-latest.js"></script>
 <script src="layui/layui.js"></script>
<div align="center" style="margin-top:20px;">
<script src="js/config.js"></script>
	 
<form id="userForm" class="layui-form layui-form-pane" enctype="multipart/form-data"   method="post" action="" style="margin-top: 20px;">
<div class="center_con1">
        <div class="center_con_left">
            <div class="sign_logo"></div>
            <div class="input_sign1" align="left">
                <div style="border: 1px solid #a7dbff; padding: 15px; margin-bottom: 20px; background-color: #e0effe; border-radius: 6px;">
                	 
                    <div class="input_sub" align="left">
                        <p style="margin-right: 15px; margin-left: 80px; font-size: 12px; color: #666; margin-bottom: 5px;">提示：邮箱将作为您的登录账号</p>
                        <label>电子邮箱：</label><input id="txtEmail"  onchange="check()" name="OrdinaryUserEmail" type="email" class="input_style">
                    </div>
                    <div class="input_sub1" align="left">
                        <label></label>
                    </div>
                    <div class="input_sub1" align="left">
                        <p style="margin-right: 50px; margin-left: 52px; font-size: 12px; color: #666; margin-top: 5px;">提示：密码长度为8-18位字符</p>
                        <label>密码：</label><input id="txtPassword" onchange="password()" name="OrdinaryUserPassword" type="password" class="input_style">

                    </div>
                    
                </div>
				<p style="font-weight: bolder; margin-left: 15px; margin-bottom: 10px; color: #666">个人资料</p>
                <div style="border-bottom: 1px solid #a7dbff; border-top: 1px solid #a7dbff; padding: 15px; margin-bottom: 20px;">

                    <div class="input_sub" align="left">
                        <label style="color: #888">证件类型：</label>
                        <select id="selectIDType"   class="input_style3"  style="overflow: hidden">
                           <option value="1">中华人民共和国居民身份证</option>
                                <option value="2">台湾居民往来大陆通行证</option>
                                <option value="3">港澳居民来往内地通行证</option>
                                <option value="4">军人证件</option>
                                <option value="5">护照</option>
                                <option value="6">香港身份证</option>
                                <option value="7">澳门身份证</option>
                        </select>

                    </div>
                    <div class="input_sub2" align="left">
                        <label style="color: #888">证件号：</label><input id="txtIDNumber" name="IdNumber" onchange="isCardID()" type="text" class="input_style" style="background-color: rgb(255, 255, 255);"><label class="redStar" style="display: inline;">*</label>
                    </div>
                    <div class="input_sub1" align="left">
                        <label style="color: #888">姓名：</label><input id="txtName" name="OrdinaryUserName" type="text" class="input_style"><label class="redStar" style="display: inline;">*</label>
                    </div>
                </div>
				 
				 <div class="input_sub1" align="left">
    <label class="layui-form-label">头像</label>
    <div class="layui-input-block">
      <input type="file" name="files" multiple="multiple" id="files" lay-verify="OrdinaryUserImg" autocomplete="off" placeholder="请输入头像" class="input_style"/>
    </div>
  </div>
  
				<div class="layui-form-item" align="center">
					<div class="layui-input-block" style="margin-left: 10px;">
						<button class="layui-btn" lay-submit="" lay-filter="userSubmit">提交</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
			</form>
		</div>
		</div>

	  <div class="center_con_right">
            <div class="login_con">
                <div style="font-size: 18pt; padding-top: 10px; color: #333; font-size: 14px; margin-top: 50px; margin-left: 25px;" align="left">
                    <strong>已有账号,直接登录：</strong>
                </div>
                <div align="center" style="margin-top: 35px;">
                	 <a href="ulogin.html">
                         <input type="button"  class="layui-btn "  value="登录 " >
                  </a>
                </div>
                <div class="line_bg_sign"></div>
                <div class="other_select1" align="left">
                </div>
            </div>
        </div>
          
    </div>
   </div>
    
<script src="layui/layui.js"></script>
 <script>
 
 function password()
 {
	 
         var pwd = $("#txtPassword").val();
         if(pwd.length<6)
        	 {
        	 layer.msg("密码最少8位！")
        	 }
         if(pwd.length>18)
    	 {
    	 layer.msg("密码最长为18位！")
    	 }
         
        
 }
 function check(){
	    var reg = new RegExp("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$"); //正则表达式
	    var obj = document.getElementById("txtEmail"); //要验证的对象
	    if(obj.value === ""){ //输入不能为空
	        layer.msg("输入不能为空!");
	        return false;
	    }else if(!reg.test(obj.value)){ //正则验证不通过，格式不对
	    	layer.msg("邮箱验证不通过!");
	        return false;
	    }else{
	        return true;
	    }
	}
   
 function isCardID(){
	 sId=$("#txtIDNumber").val();
	 var iSum=0 ;
	 var info="" ;
	 if(!/^\d{17}(\d|x)$/i.test(sId))
		 layer.msg("你输入的身份证长度或格式错误");
	 sId=sId.replace(/x$/i,"a");
	 if(aCity[parseInt(sId.substr(0,2))]==null) 
		 layer.msg("你的身份证地区非法");
	 sBirthday=sId.substr(6,4)+"-"+Number(sId.substr(10,2))+"-"+Number(sId.substr(12,2));
	 var d=new Date(sBirthday.replace(/-/g,"/")) ;
	 if(sBirthday!=(d.getFullYear()+"-"+ (d.getMonth()+1) + "-" + d.getDate()))
		 layer.msg("身份证上的出生日期非法");
	 for(var i = 17;i>=0;i --) iSum += (Math.pow(2,i) % 11) * parseInt(sId.charAt(17 - i),11) ;
	 if(iSum%11!=1) 
		 layer.msg("你输入的身份证号非法");
	 //aCity[parseInt(sId.substr(0,2))]+","+sBirthday+","+(sId.substr(16,1)%2?"男":"女");//此次还可以判断出输入的身份证号的人性别
	 return true;
	}
 
 
 layui.use('table', function() {
		var table = layui.table,
			form = layui.form;
 
		form.on('submit(userSubmit)', function(data) {
			formSubmit(data);
			return false;
		});
	});
	function formSubmit(obj) {
var formData = new FormData(document.getElementById("userForm"));//表单id
$.ajax({
   url: rooturl+'addUserInfo' ,
   type: 'POST',
   data: formData,
   async: false,
   cache: false,
   contentType: false,
   processData: false,
   success: function (data) {
    layer.alert("注册成功！",function(){
    	window.location.href="ulogin.html";
    });
  
 
   }
});	 
	} 
 </script>
	</body>
</html>